package com.lanou.bookstore.order.web.servlet.admin;

import com.lanou.bookstore.order.dao.OrderDao;
import com.lanou.bookstore.order.dao.OrderDaoImpl;
import com.lanou.bookstore.order.domain.Order;
import com.lanou.bookstore.order.domain.OrderItem;
import com.lanou.bookstore.order.domain.Transit;
import com.lanou.bookstore.order.service.OrderSercice;
import com.lanou.bookstore.order.service.OrderSerciceImpl;
import com.lanou.bookstore.user.dao.UserDao;
import com.lanou.bookstore.user.dao.UserDaoImpl;
import com.lanou.bookstore.user.domain.User;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/aos")
public class AdminOrderServlet extends HttpServlet {

    UserDao userDao = new UserDaoImpl();
    OrderDao orderDao = new OrderDaoImpl();
    OrderSercice os = new OrderSerciceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        List<Order> adminOrderList = orderDao.queryAll();
        List<Transit> adminOrderItemList = orderDao.queryAll2();

        req.getSession().setAttribute("adminOrderList",adminOrderList);
        req.getSession().setAttribute("adminOrderItemList",adminOrderItemList);
        req.getRequestDispatcher("/adminjsps/admin/order/list02.jsp").forward(req,resp);
    }
}
